<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>清除浮动</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        /* 清除浮动：双伪元素元素清除 */
        .clearfix:before,
        .clearfix:after {
            content: "";
            display: table;
        }
        .clearfix:after {
            clear: both;
        }
        .clearfix {
            *zoom:1;
        }

        /* .clearfix:after {
            content: "";
            display: block;
            height: 0;
            clear: both;
            visibility: hidden;
        }
        .clearfix {
            *zoom:1;
        } 
        清除浮动：after伪元素*/
        .box {
            /* overflow: hidden; */
            /* overflow: hidden;清除浮动 */
            width: 800px;
            border: 1px solid black;
            margin: 0 auto;
        }

        .mini {
            float: left;
            width: 200px;
            height: 200px;
            background-color: pink;
        }

        .max {
            float: left;
            width: 200px;
            height: 200px;
            background-color: skyblue;
        }

        .footer {
            height: 150px;
            background-color: #f5f5f5;
        }
    </style>
</head>

<body>
    <div class="box clearfix">
        <div class="mini"></div>
        <div class="max"></div>
    </div>
    <div class="footer"></div>
</body>

</html>